<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<link rel="stylesheet" href="./css/all.css">
<style>
    .idiv {
        width: 100px;
        height: 20px;
        border:  1px red solid;
         margin: 10px auto;
         

    }
 .flex_div{
    display: fixed;
    flex-direction: column ;
   
 }
    .fa-exclamation{
         padding-left:  60%;
         line-height: 20px;
    }
</style>

<body>
    <div class="flex_div">
      <div class=" idiv divs1"> 1<i class=" fas fa-exclamation"></i></div>
      <div class=" idiv divs2"> 2<i class=" fas fa-exclamation"></i></div>
      <div class=" idiv divs3"> 3<i class=" fas fa-exclamation"></i></div>
     </div>
    <script>
        let set= new WeakSet();
      let i=document.querySelectorAll(".fas")
    //   console.log(i);
      i.forEach(v=>{
        //   console.log(v);
        v.addEventListener("click",()=>{
            set.add(v.parentNode)
            console.log(set.has(v.parentNode));
            v.parentNode.remove(v);
            set.delete(v.parentNode);
            console.log(set.has(v.parentNode));
           
        })
      })
    </script>
</body>
</html>